package server.handler.groupHandler;

import com.alibaba.fastjson.JSONObject;
import common.EnvelopeMessage;
import common.bodies.GroupShipBody;
import server.dao.GroupDao;
import server.handler.SimpleHandler;
import server.session.Session;

public class GroupRequestHandler implements SimpleHandler {
    @Override
    public void handle(EnvelopeMessage msg, Session session) {
        JSONObject body = msg.getBody();
        Integer userId = body.getInteger("userId");
        Integer groupId = body.getInteger("groupId");
        String groupName = body.getString("groupName");
        GroupShipBody groupShip = new GroupShipBody(userId,groupId,groupName,0,0);
        new GroupDao().updateGroupShip(groupShip);
    }
}
